/*
销售业务
*/
// ========调价========
import httpRequest from '@/utils/httpRequest'
// 销售调价：业务列表
export function getList (data) {
  return httpRequest({
    url: '/businessProduct/list',
    method: 'get',
    params: data
  })
}
// 调价历史：左侧货物列表
export function getProductIndexList (data) {
    return httpRequest({
        url: '/businessProduct/getProductIndexList',
        method: 'get',
        params: data
    })
}
// 销售调价：删除
export function businessProductDelete (data) {
  return httpRequest({
    url: '/businessProduct/delete',
    method: 'post',
    data: data
  })
}
// 新增销售调价或修改销售调价
export function saveAdjust (data) {
  return httpRequest({
    url: '/businessProduct',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 调价历史
export function getHistoryList (data) {
  return httpRequest({
    url: '/businessProduct/businessProductHistory',
    method: 'get',
    params: data
  })
}

// ========业务========
// 销售业务列表
export function getBusinessList (data) {
  return httpRequest({
    url: '/business/businessList',
    method: 'get',
    params: data
  })
}
export function getBusinessInfoList (data) {
  return httpRequest({
    url: '/business/businessInfoList',
    method: 'get',
    params: data
  })
}
// 根据id获取业务数据信息是否不完整/不合法
export function getModelInfo (data) {
  return httpRequest({
    url: '/business/getModelInfo',
    method: 'get',
    params: data
  })
}
// 提交业务执行审批流程
export function confirmBusiness (data) {
  return httpRequest({
    url: '/business/confirmBusiness',
    method: 'get',
    params: data
  })
}

// 获取状态
export function getStateById (data) {
  return httpRequest({
    url: '/business/getStateById',
    method: 'get',
    params: data
  })
}
// 批量修改业务状态
export function updateBusinessState (data) {
  return httpRequest({
    url: '/business/updateState',
    method: 'post',
    data: data
  })
}
// 批量删除业务
export function deleteBusiness (data) {
  return httpRequest({
    url: '/business/delete',
    method: 'post',
    data: data
  })
}
// ========详情========
// 销售业务列表
export function getBusinessInfo (data) {
  return httpRequest({
    url: '/business/getBusinessInfo',
    method: 'get',
    params: data
  })
}
// ========路耗========
// 路耗设置列表
export function getLossList (data) {
  return httpRequest({
    url: '/business/getLossList',
    method: 'get',
    params: data
  })
}
// 路耗详情
export function getLossInfo (data) {
  return httpRequest({
    url: '/business/getLossInfo',
    method: 'get',
    params: data
  })
}
// 根据模型id获取路耗模型模版设置
export function getModelLossData (data) {
  return httpRequest({
    url: '/business/getModelLossData',
    method: 'get',
    params: data
  })
}

// 路耗设置列表
export function updateLossState (data) {
  return httpRequest({
    url: '/business/updateLossState',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 新增或修改路耗
export function saveLoss (data) {
  return httpRequest({
    url: '/business/saveLoss',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 删除路耗设置
export function deleteLoss (data) {
  return httpRequest({
    url: '/business/deleteLoss',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// ========扣重========
// 扣重详情
export function getDeductInfo (data) {
  return httpRequest({
    url: '/business/getDeductInfo',
    method: 'get',
    params: data
  })
}

// 扣重设置列表
export function getDeductList (data) {
  return httpRequest({
    url: '/business/getDeductList',
    method: 'get',
    params: data
  })
}

// 根据模型id获取扣重模型规则设置
export function getModelDeductData (data) {
  return httpRequest({
    url: '/business/getModelDeductData',
    method: 'get',
    params: data
  })
}

// 扣重修改状态
export function updateDeductState (data) {
  return httpRequest({
    url: '/business/updateDeductState',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 新增或修改扣重
export function saveDeduct (data) {
  return httpRequest({
    url: '/business/saveDeduct',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 删除扣重设置
export function deleteDeduct (data) {
  return httpRequest({
    url: '/business/deleteDeduct',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// ========数量调整========
// 数量调整列表
export function getAdjustList (data) {
  return httpRequest({
    url: '/business/getAdjustList',
    method: 'get',
    params: data
  })
}

// 新增或修改数量
export function saveBusinessAdjust (data) {
  return httpRequest({
    url: '/business/saveAdjust',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 数量调整详情
export function getAdjustInfo (data) {
  return httpRequest({
    url: '/business/getAdjustInfo',
    method: 'get',
    params: data
  })
}
// 删除数量调整
export function deleteAdjust (data) {
  return httpRequest({
    url: '/business/deleteAdjust',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// ========货物明细========
// 货物明细左侧货物列表
export function getProductList (data) {
  return httpRequest({
    url: '/business/getProductList',
    method: 'get',
    params: data
  })
}

// 根据货物id获取货物明细
export function getProductInfo (data) {
  return httpRequest({
    url: '/business/getProductInfo',
    method: 'get',
    params: data
  })
}

// ========质量要求========
// 质量要求左侧货物列表
export function getProductQuatityIndexList (data) {
  return httpRequest({
    url: '/business/getProductQuatityIndexList',
    method: 'get',
    params: data
  })
}

// 根据货物id获取质量要求
export function getProductQuatityIndexInfo (data) {
  return httpRequest({
    url: '/business/getProductQuatityIndexInfo',
    method: 'get',
    params: data
  })
}
// 质量要求详情
export function getQuatityIndexInfo (data) {
  return httpRequest({
    url: '/business/getQuatityIndexInfo',
    method: 'get',
    params: data
  })
}
// 新增或修改质量要求
export function saveProductQuatityIndex (data) {
  return httpRequest({
    url: '/business/saveProductQuatityIndex',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 删除质量要求
export function deleteProductQuatityIndex (data) {
  return httpRequest({
    url: '/business/deleteProductQuatityIndex',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// ========磅单设置========
// 磅单设置下拉框
export function getWeightTemplateSelectData (data) {
  return httpRequest({
    url: '/business/getWeightTemplateSelectData',
    method: 'get',
    params: data
  })
}

// 磅单详情
export function getWeightTemplateInfo (data) {
  return httpRequest({
    url: '/business/getWeightTemplateInfo',
    method: 'get',
    params: data
  })
}
// 获取列表
export function getWeightTemplateList (data) {
  return httpRequest({
    url: '/business/getWeightTemplateList',
    method: 'get',
    params: data
  })
}
// 相关设置：根据模型id获取磅单模型规则设置
export function getModelWeightTemplateData (data) {
  return httpRequest({
    url: '/business/getModelWeightTemplateData',
    method: 'get',
    params: data
  })
}
// 新增磅单设置
export function saveWeightTemplate (data) {
  return httpRequest({
    url: '/business/saveWeightTemplate',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 更新磅单设置状态
export function updateWeightTemplateState (data) {
  return httpRequest({
    url: '/business/updateWeightTemplateState',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 删除磅单设置
export function deleteWeightTemplate (data) {
  return httpRequest({
    url: '/business/deleteWeightTemplate',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
//获取下拉框数据
export function getSelectData (data) {
  return httpRequest({
    url: '/financeTenantAccount/getSelectData',
    method: 'get',
    params: data,
  })
}
// 选择业务弹窗
export function getWindowList (data) {
    return httpRequest({
        url: '/business/selectWindowList',
        method: 'get',
        params: data
    })
}

// 业务执行逻辑
export function adjustTheBusiness (data) {
    return httpRequest({
        url: '/business/adjustTheBusiness',
        method: 'post',
        data: data,
        headers: {'Content-Type': 'application/json; charset=utf-8'}
    })
}
